package test.org.lcx.pipeline.bean;

import java.util.Map;

import org.lcx.pipeline.Processor;
import org.lcx.pipeline.bean.PipelineExeption;
import org.lcx.pipeline.bean.PipelineResult;

/**
 * Created by luocheng on 2016/04/05.
 */
public class OrderProcessor implements Processor{


	@Override
	public int runProcess(Object pParam, PipelineResult pinelineResult)
			throws PipelineExeption {
		Map<String,Object> params = (Map<String,Object>)pParam;
		Integer memberLevel = (Integer)params.get("memberLevel");
//		if(memberLevel == null){
//			pinelineResult.addError("paramNotExist", "adsfabc");
//			throw new RuntimeException("没有参数");
////			return 2;
//		}
		if(memberLevel == 2){
			System.out.println("大客户，应该双倍积分");
		}else if(memberLevel == 3){
			System.out.println("普通客户，只有单倍");
		}
//		if(memberLevel != 2){
//			pinelineResult.addError("orderError", "orderError");
//		}
		System.out.println("==============订单处理===============");
		return 200;
	}


}
